package com.neu.cpsp.service.impl;/*
    @author neu.xiangwenjuan
    @create 2022/3/29
*/

import com.neu.cpsp.dao.EvaluateRecordToEmployeeMapper;
import com.neu.cpsp.pojo.EvaluateRecordRelated;
import com.neu.cpsp.pojo.EvaluateRecordToEmployee;
import com.neu.cpsp.service.EvaluateRecordToEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class EvaluateRecordToEmployeeServiceImpl implements EvaluateRecordToEmployeeService {
    @Autowired
    private EvaluateRecordToEmployeeMapper mapper;

    @Override
    public int insertRecord(EvaluateRecordToEmployee record) {
        return mapper.insertEvaluateRecordToEmployee(record);
    }

    @Override
    public int deleteInfoByRecordId(Integer evaluateRecordId) {
        return mapper.deleteInfoByRecordId(evaluateRecordId);
    }

    @Override
    public List<EvaluateRecordRelated> selectRelatedEmployees(Integer evaluateRecordId) {
        return mapper.selectRelatedEmployees(evaluateRecordId);
    }

    @Override
    public int deleteRelatedEmployee(Integer id) {
        return mapper.deleteRelatedEmployee(id);
    }

    @Override
    public int updateByPrimaryId(Integer id, Double proportionOfPunishment) {
        return mapper.updateByPrimaryId(id, proportionOfPunishment);
    }
}
